package de.wwu.ifgi.gischool.ar;

import java.util.ArrayList;

import android.app.Activity;
import android.os.Bundle;
import android.widget.ImageView;
import android.widget.TextView;
import de.wwu.ifgi.gischool.ar.app.ArApplication;
import de.wwu.ifgi.gischool.ar.pojo.PoiBean;

public class DetailActivity extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		setContentView(R.layout.activity_detail);

		ArApplication arApplication = (ArApplication) getApplication();
		ArrayList<PoiBean> poiBeans = arApplication.getPoiBeans();

		String selectedPOI = arApplication.getSelectedPOI();

		for (PoiBean poiBean : poiBeans) {
			if (poiBean.getId().equals(selectedPOI)) {
				String name = poiBean.getName();

				String beschreibung = poiBean.getDescription();

				TextView editText2 = (TextView) findViewById(R.id.editText2);

				editText2.setText(name);

				TextView editText1 = (TextView) findViewById(R.id.editText1);

				editText1.setText(beschreibung);

				ImageView imageView1 = (ImageView) findViewById(R.id.imageView1);

				imageView1.setImageResource(poiBean.getImg());

			}

		}
	}

}
